﻿using System;
using System.Net;

namespace Maelu.Classes
{
    public class ScreenScraper
    {

        public static string getCookieSource(int itemID, int serverID)
        {
            
            //FFXIAH's sid cookie is +1 from the games serverID.
            serverID++;
            
            using (var webClient = new WebClient())
            {
                webClient.Headers.Add(HttpRequestHeader.Cookie, "sid=" + serverID + ";");
                webClient.Headers.Add(HttpRequestHeader.UserAgent, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1468.0 Safari/537.36");
                return webClient.DownloadString(@"http://www.ffxiah.com/item/" + itemID + "/");
            }

        }

    }
}
